const getList = (author, keyword) => {
    /*先返回假数据(格式是正确的)*/
    return [
        {
            id: 1,
            title: '博客1',
            content: '内容A',
            createTime: 1565598219544,
            author: 'Jean'
        },
        {
            id: 2,
            title: '博客2',
            content: '内容B',
            createTime: 1565598369809,
            author: 'Jean'
        }
    ]
};

const getDetail = id => {
    return [
        {
            id: 1,
            title: '博客1',
            content: '内容A',
            createTime: 1565598219544,
            author: 'Jean'
        }
    ]
};

const newBlog = (blogData = {}) => {
    /*blogData 是一个博客对象，包含 title，content，属性等*/
    return {
        id: 3 // 表示新建博客，插入到数据表里的id
    }
};

const updateBlog = (id, blogData = {}) => {
    /*id：要更新博客的id*/
    /*blogData 是一个博客对象，包含 title，content，属性等*/
    return true;
};

const deleteBlog = (id) => {
    /*id：要更新博客的id*/
    return true;
};

module.exports = {getList, getDetail, newBlog, updateBlog, deleteBlog};
